<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>表单提交2</title>
	<body>
		<div id="app">
			<!-- 属性说明: 
					1.number 将用户输入变为数值类型
					2.trim   去掉开头和结尾的空格
					3.lazy   将input事件改为change事件(懒加载)
			 -->
			 <input name="age" v-model.number="age"/>
			 <button @click="add">增加10</button><br>
			 <input name="name" v-model.trim="name"/>
			 获取name属性长度 {{name.length}}<br>
			 <input name="username" v-model.lazy="username"/>
			 观察响应现象{{username}}
			
			 			
		</div>
		<script src="https://cdn.jsdelivr.net/npm/vue@2"></script>
		<script>
			const app = new Vue({
				el: '#app',
				data: {
					age: '',
					name: '',
					username:''
				},
				methods: {
					add(){
						this.age = 10 + this.age
					}
				}
			}) 
		</script>
	</body>
</html>